package com.nky.service.impl;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nky.mapper.FilesMapper;
import com.nky.pojo.Files;
import com.nky.service.IFilesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements IFilesService {
    @Autowired
    private FilesMapper filesMapper;

    public Page<JSONObject> getRootPath(Page<Files> page) {
        Page<JSONObject> rootPath = filesMapper.getRootPath(page);
        return rootPath;
    }

    public Page<JSONObject> getFilesByPath(Page<Files> page,int pathLevel, String filePath) {
        Page<JSONObject> list = filesMapper.getFilesByPath(page,pathLevel, filePath);
        System.out.println("service list" + list);
        return list;
    }
}
